Error model and serializers

Custom error model that wraps active record objects and custom messages.

Fix #327
Fix #284