some formatting
added return-codes
return error-messages to caller