added error codes for all api functions