#249 REST API

Refactoring