test notes api and fix bug