Added jasmine tests and return value handling

Jira Issue: WP-123