added better support for the api