Updated api, models and corresponding tests

Updated api and corresponding tests

Added comments
Merge pull request #473 from sammyshj/apipart2

Updated models and corresponding tests