Added spec for api, fixed rspec