Changed the way that api responses are send to the method handlers