Add server side error handling

Add directive for serverside validation