Add handling of error messages from API calls

Add basic user authentication support