More work on custom api client