Add proper status code for error
Add tests for model and views