updated api tasks controller
updated rspec tests for api