Fixes #6971,bz1085417 - api handle nonexistent id

In capsule and product APIs, the show action for a nonexistant id fails
to give a proper 404.

for example /api/products/123123 where product 123132 does not exist
product gives 500 no resource loaded

capsule gives protected method `resource_name' called for
`Product.find_by_id(params[:id])` will return nil if there is no params[:id], if you can remove `if params[:id]`