Added comments in API and updated readme code.