How to create multiple records by a single controller call and getting some data back to user

What is the best way to create multiple records at once (by a controller call) and getting for example the id of first and last records back to UI / JSON response?

What have you tried so far, and what problems did you run into?