Fixed next-href.
Removed db collection logic from api_controller.