fix some response stuff in api.php