added sorting capability to api
refactored controller code
added rake task to seed data