Modified request code to handle non-restful requests.