fixed serverside bugs
added test for REST API