refactored to support put, get, delete and post verbs