Made some enhancements to the API