fix rest service
fix db queries, javadoc