Added integration tests for names api. Fixed some bugs.