Modified Auth in api.php

Modified auth to return a JSON object instead of JSON array,