Added error messages to API