Cleaned up the options handling and the api_send method