Added error codes to api_front