Fixed token expiration check and parameters passed to api