Fix http return codes and rename method

Change-Id: Ie8af71f726266d8ac1203c756074f053dc93199f