Moved api stuff into api namespace