Fixed the user specs and bug in api controller