Fix edge case when user sends a request with empty email and password
Add json response when requests are 401 and 400 on sessions endpoint

This is necessary because some JS framework don't work well when the response
is empty.