Phase one - restructure of functions (react to HTTP get,post,delete,put methods)