did some refactoring and using goweb for the rest api