#31 Added backend tests and fixed some bugs related to buying bitcoin

Please review