setStatusCode method to return self