added optional params for token and device id
created tests for APIController