Bug #2179: Wrong owner_type on the request returns 500

This pull request validates the owner type. This will fix the problem where the API returns 500 with a malformed request that contains a wrong owner_type. Instead it returns a 422 with info on how to solve the error.