changed to handle all methods of requests