implementation of POST, PUT & DELETE, some refactors