Added some more api functions and tidied up some inconsistencies