Forcing locations on *_tpl in the backend

Locations (URIs/URLs) must be handled by the server core
regardless of what the backend set as a location. For now,
this is done only for os_tpl and resource_tpl instances.
Added another custom error for the backends
Updated error handling in the controllers

Controllers are now catching internal backend errors and
sending 500 + message to the clients.
Added small helper for checking ON retvals
Checking ON's retval in the os_tpl backend module
Fixed retval check in the ON backend (os_tpl)