moved api error codes to api