updates to api functions, includes type checking for dimensions function
API implementation for basic use case, added comments.