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.

Two examples, with curl and hammer:

```
curl localhost:3000/api/subnets/232
HTTP/1.1 404 Not Found
{"message":"Resource subnet not found by id '232'"}
```

```
hammer --output base subnet create --name "allparams" --network "251.10.10.11" --mask "255.255.255.0" --gateway "251.10.10.255" --dns-primary "251.10.11.255" --dns-secondary "251.10.12.255" --from "251.10.10.10" --to "251.10.10.12" --vlanid "2" --domain-ids "1"

Could not create the subnet:
  404 Resource Not Found
```

In the latter example, Foreman fails to find a domain with id '1'. However hammer does not show the full content of the response, which is ```{"message":"Resource domain not found by id '1'"}```

http://projects.theforeman.org/issues/3515