Return 401 when action is not authorized

When a user is not authorized to access to something is the API,
this one return 401 instead of 400 now.

Fixes bug #1232045

Change-Id: I7ef8ed1f7cd40a845bcf860561c2cb7da52fb9e9
db2 does not allow None as a key for user_id in user collection

mongodb allows None value as a key for _id field, but db2 does not.
this patch will fix the problem when meters coming with user_id
being set to None.

Change-Id: If48e5117198f3e9ad834e4f7fa58ec27c57a8bc8
fixes: bug #1234165
Merge "db2 does not allow None as a key for user_id in user collection"
Merge "Return 401 when action is not authorized"