added status codes for errors in controller