Changed API errors to status code + custom JSON object