Fix wrong error message

closes #1466
- added status code for error object
- added test for frontend errors