public static function successfulHttpStatusCode($method, $model = null)
    {
        // if we did a put request, we need to ensure that the model wasn't
        // changed in other ways than those specified by the request
        //     Ref: http://jsonapi.org/format/#crud-updating-responses-200
        if (($method === 'PATCH' || $method === 'PUT') && $model instanceof Model) {
            // check if the model has been changed
            if ($model->isChanged()) {
                // return our response as if there was a GET request
                $method = 'GET';
            }
        }

        switch ($method) {
            case 'POST':
                return BaseResponse::HTTP_CREATED;
            case 'PATCH':
            case 'PUT':
            case 'DELETE':
                return BaseResponse::HTTP_NO_CONTENT;
            case 'GET':
                return BaseResponse::HTTP_OK;
        }

        // Code shouldn't reach this point, but if it does we assume that the
        // client has made a bad request.
        return BaseResponse::HTTP_BAD_REQUEST;
    }