Bug #3515 - API handles not found objects with 404

This PR makes the API return sensible 404s (it used to return 500) when it cannot found something needed.




http://projects.theforeman.org/issues/3515