minor changes in controller, added http codes