update docs about rest api
fix routes and improve code
fix failing tests for new rest routes