Added test for userapi and completely tested userapi