Remove fail() method from api

and replace it with sendJsonWithStatus().