Couple of bugs fixed in api and user controller