Updated api, models and corresponding tests

Updated api and corresponding tests

Added comments