I usually return this:
//Return the status code $this->response->statusCode(201); //then: return json_encode(value);