fixed bugs; improved rest api; etc