Cleaned up the api