RESTful API & git scripts

+ some refactoring